package com.ruoyi.fangyuan.webmagic;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @Title: RedisPool
 * @Description:
 * @Auther: 龙天
 * @Version: 1.0
 * @create 2023/5/11 17:20
 */
@Configuration
public class RedisPool {

    @Bean
    public JedisPool jedisPool(){
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxTotal(100);
        config.setMaxIdle(10);
        config.setTestOnBorrow(true);
        JedisPool jedisPool = new JedisPool(config,"127.0.0.1",6379,5000);
        return jedisPool;
    }






}
